package com.example.demo.controller;

import com.example.demo.Mappers.GetZYFYListMapper;
import com.example.demo.beans.GetZYFYList;
import com.example.demo.beans.GetZYFYListRequest;
import com.example.demo.beans.GetZYFYListResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018-05-26.
 */
@RestController
public class GetZYFYListController {
    @Autowired
    private  GetZYFYListMapper mapper;
    @ResponseBody
    @RequestMapping(value = "GetZYFYList",produces = {"application/xml"})
    public GetZYFYListResponse getZyfyList(@RequestBody(required = false)GetZYFYListRequest request)
    { GetZYFYListResponse response =new GetZYFYListResponse();
        if(request!=null)
    {
        List<GetZYFYList> lists=mapper.getzyfhmx(request.getCardNo(),request.getStartDate(),request.getEndDate());
      response.setResultCode("0");
      response.setResultMsg("交易成功！");
      response.setItems(lists);
      return  response;
    }
    response.setResultCode("0");
    response.setResultMsg("请求数据为空！");
    return  response;

    }
}
